Optimal. Leaf size=103 \[ \frac {(b c-a d)^2 \log (a \cos (e+f x)+b \sin (e+f x))}{b f \left (a^2+b^2\right )}+\frac {a x (b c-a d)^2}{b^2 \left (a^2+b^2\right )}+\frac {d x (2 b c-a d)}{b^2}-\frac {d^2 \log (\cos (e+f x))}{b f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3541, 3475, 3484, 3530} \[ \frac {(b c-a d)^2 \log (a \cos (e+f x)+b \sin (e+f x))}{b f \left (a^2+b^2\right )}+\frac {a x (b c-a d)^2}{b^2 \left (a^2+b^2\right )}+\frac {d x (2 b c-a d)}{b^2}-\frac {d^2 \log (\cos (e+f x))}{b f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3484
Rule 3530
Rule 3541
Rubi steps
\begin {align*} \int \frac {(c+d \tan (e+f x))^2}{a+b \tan (e+f x)} \, dx &=\frac {d (2 b c-a d) x}{b^2}+\frac {d^2 \int \tan (e+f x) \, dx}{b}+\frac {(b c-a d)^2 \int \frac {1}{a+b \tan (e+f x)} \, dx}{b^2}\\ &=\frac {a (b c-a d)^2 x}{b^2 \left (a^2+b^2\right )}+\frac {d (2 b c-a d) x}{b^2}-\frac {d^2 \log (\cos (e+f x))}{b f}+\frac {(b c-a d)^2 \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )}\\ &=\frac {a (b c-a d)^2 x}{b^2 \left (a^2+b^2\right )}+\frac {d (2 b c-a d) x}{b^2}-\frac {d^2 \log (\cos (e+f x))}{b f}+\frac {(b c-a d)^2 \log (a \cos (e+f x)+b \sin (e+f x))}{b \left (a^2+b^2\right ) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.22, size = 108, normalized size = 1.05 \[ \frac {\frac {2 (b c-a d)^2 \log (a+b \tan (e+f x))}{b \left (a^2+b^2\right )}-\frac {(c-i d)^2 \log (\tan (e+f x)+i)}{b+i a}+\frac {(c+i d)^2 \log (-\tan (e+f x)+i)}{-b+i a}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 129, normalized size = 1.25 \[ -\frac {{\left (a^{2} + b^{2}\right )} d^{2} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (a b c^{2} + 2 \, b^{2} c d - a b d^{2}\right )} f x - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a^{2} b + b^{3}\right )} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.00, size = 127, normalized size = 1.23 \[ \frac {\frac {2 \, {\left (a c^{2} + 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} - \frac {{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b + b^{3}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.20, size = 249, normalized size = 2.42 \[ \frac {\ln \left (a +b \tan \left (f x +e \right )\right ) a^{2} d^{2}}{f \left (a^{2}+b^{2}\right ) b}-\frac {2 \ln \left (a +b \tan \left (f x +e \right )\right ) a c d}{f \left (a^{2}+b^{2}\right )}+\frac {b \ln \left (a +b \tan \left (f x +e \right )\right ) c^{2}}{f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a c d}{f \left (a^{2}+b^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{2} b}{2 f \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b \,d^{2}}{2 f \left (a^{2}+b^{2}\right )}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) a \,c^{2}}{f \left (a^{2}+b^{2}\right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) a \,d^{2}}{f \left (a^{2}+b^{2}\right )}+\frac {2 \arctan \left (\tan \left (f x +e \right )\right ) b c d}{f \left (a^{2}+b^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.88, size = 123, normalized size = 1.19 \[ \frac {\frac {2 \, {\left (a c^{2} + 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{2} b + b^{3}} - \frac {{\left (b c^{2} - 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.73, size = 115, normalized size = 1.12 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-c^2\,1{}\mathrm {i}+2\,c\,d+d^2\,1{}\mathrm {i}\right )}{2\,f\,\left (a+b\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^2+c\,d\,2{}\mathrm {i}+d^2\right )}{2\,f\,\left (b+a\,1{}\mathrm {i}\right )}+\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (a\,d-b\,c\right )}^2}{b\,f\,\left (a^2+b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.33, size = 1040, normalized size = 10.10 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________